#!/bin/sh

general=$(uci -q get speederv2.@general[-1])

if [ -z "$general" ]; then
	uci -q add speederv2 general
fi

if [ "$general" != "general" ]; then
	uci -q batch <<-EOF > /dev/null
		rename speederv2.@general[-1]="general"
		set speederv2.@general[-1].server="nil"
		commit speederv2
	EOF
fi

rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
exit 0
